<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:50:"E:\WWW\waimai/app/wechat/order\view\order\pay.html";i:1505792800;s:54:"E:\WWW\waimai/app/wechat/order\view\template\base.html";i:1502523229;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>外卖</title>
    <link rel="stylesheet" href="__STATIC__/css/mui.min.css">
    <link rel="stylesheet" href="__STATIC__/css/ks.css">
    
    <script>
        var require_path = "__STATIC__/app";
    </script>
    <script src="__STATIC__/app/plugin/wechat/weixin.js"></script>
    <script src="__STATIC__/app/require.js"></script>
    <script src="__STATIC__/app/require.config.js"></script>
    <script src="__STATIC__/app/plugin/jquery-3.2.1.min.js"></script>
    <script src="__STATIC__/app/plugin/mui/mui.min.js"></script>
    
</head>
<body>



<body>
<header class="header">
    <div>
        <a class="back" href=<?php echo $back_url; ?>><i class="iconfont icon-zuoyoujiantou-copy-copy-copy"></i></a>
        收银台
    </div>
</header>
<div id="pay_page" class="pages">
    <template>
    <div class="list-form other not-t">
        <ul>
            <li>
                订单编号：
                <span class="pull-right">{{order.order_sn}}</span>
            </li>
            <li>
                订单金额：
                <span class="pull-right color-primary">￥{{order.total_amount}}</span>
            </li>
        </ul>
        <!--<ul>
            <li>
                <a href="" class="list-form-link">
                    <div class="icon"><i class="iconfont icon-weixin"></i></div>
                    <div>
                        <div>微信支付</div>
                        <p>微信安全支付</p>
                    </div>
                </a>
            </li>
            <li>
                <a href="" class="list-form-link">
                    <div class="icon"><i class="iconfont icon-yue"></i></div>
                    <div>
                        <div>余额支付</div>
                        <p>当前余额：1000.00</p>
                    </div>
                </a>
            </li>
            <li>
                <a href="" class="list-form-link">
                    <div class="icon"><i class="iconfont icon-fukuan"></i></div>
                    <div>
                        <div>货到付款</div>
                        <p>货到付款</p>
                    </div>
                </a>
            </li>
        </ul>-->

            <ul class="cash-register">
                <li>
                    <div @tap.stop="wechat_pay(order.id)">
                        <button type="button" class="df" style="height: 50px;">
                            <i class="iconfont icon-weixin"></i>
                            微信支付
                        </button>
                    </div>
                    <div @tap.stop="balance_pay(order.id)" class="mt-unify">
                        <button type="button" class="df" style="height: 50px;">
                            <i class="iconfont icon-yue"></i>
                            余额支付(余额:{{info.money}})
                        </button>
                    </div>
                    <div @tap.stop="delivery_pay(order.id)" class="mt-unify">
                        <button type="button" class="df" style="height: 50px;">
                            <i class="iconfont icon-fukuan"></i>
                            货到付款
                        </button>
                    </div>
                </li>
            </ul>

    </div>
    </template>
</div>


</body>
<script>
    if(document.querySelector('.goback')!=null){
        document.querySelector('.goback').addEventListener('tap', function () {
            history.back();
        })
    }
    host="<?php echo \think\Request::instance()->host(); ?>";
    se_url="<?php echo \think\Request::instance()->baseUrl(); ?>";

    if(se_url=="/wechat.php"){
        current_url= 'http://'+window.location.host+se_url+'/index/index/index'+'?parent_id='+"<?php echo $account['id']; ?>";
    }else{
        current_url='http://'+window.location.host+"<?php echo \think\Request::instance()->baseUrl(); ?>"+'?parent_id='+"<?php echo $account['id']; ?>";
    }
    console.log(current_url)

    appId='<?php echo $js_sdk['appid']; ?>' ; // 必填，公众号的唯一标识
    timestamp= '<?php echo $js_sdk['time']; ?>';// 必填，生成签名的时间戳
    nonceStr= '<?php echo $js_sdk['nonceStr']; ?>'; // 必填，生成签名的随机串
    signature= '<?php echo $js_sdk['signature']; ?>';// 必填，签名，见附录1
    jsApiList= [ 'scanQRCode','onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','chooseImage','uploadImage', 'checkJsApi', 'openLocation', 'getLocation']; // 必填，需要使用的JS接口列表，所有JS接口列表见附录2

    wx.config({
        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
        appId:appId , // 必填，公众号的唯一标识
        timestamp: timestamp, // 必填，生成签名的时间戳
        nonceStr: nonceStr, // 必填，生成签名的随机串
        signature: signature,// 必填，签名，见附录1
        jsApiList: jsApiList // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
    });

    wx.checkJsApi({
        jsApiList: [ 'scanQRCode','onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','chooseImage','uploadImage', 'checkJsApi', 'openLocation', 'getLocation'],
        success: function (res) {
            // alert(JSON.stringify(res));
            // alert(JSON.stringify(res.checkResult.getLocation));
            if (res.checkResult.getLocation == false) {
                alert('你的微信版本太低，不支持微信JS接口，请升级到最新的微信版本！');
                return;
            }
        }
    });
    wx.ready(function(){
        var shareData = {
            title: '外卖',            //朋友圈文案（朋友圈没有标题）
            desc: '钦州外卖就系快',
            link:current_url,
            imgUrl:'http://wm.qzzm.com/public/wechat/static/image/default.png',
            success: function () {
                mui.toast('分享成功')
            },
            cancel: function () {
                mui.toast('您已取消分享')
            }
        };
        wx.onMenuShareTimeline(shareData);
        wx.onMenuShareAppMessage(shareData);
        wx.onMenuShareQQ(shareData);
        wx.onMenuShareWeibo(shareData);
        wx.onMenuShareQZone(shareData);
    });
</script>

<script>
    var delivery_pay_url = "<?php echo url('order/Order/delivery_pay'); ?>";
    var balance_pay_url = "<?php echo url('order/Order/balance_pay'); ?>";
    var wechat_pay_url = "<?php echo url('order/Order/order_wechat_pay'); ?>";
    var set_pay_pwd = "<?php echo url('user/Account/set_pwd'); ?>";
    var order_url = "<?php echo url('order/Order/index'); ?>";
    var pay_success = "<?php echo url('order/pay/pay_success'); ?>";
    var pay_data_url = "<?php echo url('order/Order/pay_data'); ?>";
    var order_id = "<?php echo $order_id; ?>";
    require(['order/pay']);
</script>

</html>